package com.example.demo.service;

import com.example.demo.entity.User;
import com.example.demo.exception.LoginException;
import com.example.demo.exception.ServiceException;
import com.example.demo.param.dto.user.UpdateAdminDto;

import java.util.Date;

/**
 * 处理用户数据业务层的接口
 *
 * @author admin
 *
 */
public interface IUserService {

    /**
     * 用户登录
     * @param username
     * @param password
     * @return
     * @throws LoginException
     */
    User userLog(String username, String password , Integer role) throws ServiceException;

    /**
     * 用户注册
     * @param username
     * @param password
     * @param role
     * @return
     * @throws ServiceException
     */
    Boolean userReg(String username, String password , Integer role) throws ServiceException;

    /**
     * 修改个人信息
     * @param userId
     * @param gender
     * @param birthday
     * @param produce
     * @return
     */
    Boolean updateImformation(String userId, String username , Integer gender, Date birthday, String produce);

    /**
     * 修改密码
     * @param userId
     * @param password
     * @param newPassword
     * @return
     */
    Boolean updatePassword(String userId, String password, String newPassword);

    /**
     * 修改管理员密码
     * @param dto
     * @return
     * @throws ServiceException
     */
    Boolean updateAdminPassword(UpdateAdminDto dto)throws ServiceException;

    /**
     * 删除管理员
     * @param dto
     * @return
     * @throws ServiceException
     */
    Boolean deleteAdmin(String token, String id)throws ServiceException;
}

